<%@ page language="java" contentType="text/html; charset=UTF8" pageEncoding="UTF8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF8">
<script type="text/javascript" src="component/jquery-3.1.1.js"></script>
<title>editUser</title>
<!-- <link rel="stylesheet" type="text/css" href="common/css/register.css"> -->
</head>
<body>
 <script>
$(document).ready(function(){
	var userRoleId=$("#userRoleId").val();
	//alert("userRoleId:"+typeof(userRoleId)); 

	switch (userRoleId)
	{
	case '1':
		$("#userRoleId1").attr("selected","selected");
	  break;
	case '2':
		$("#userRoleId2").attr("selected","selected");
	  break;
	case '3':
		$("#userRoleId3").attr("selected","selected");
	  break;
	case '4':
		$("#userRoleId4").attr("selected","selected");
	  break;
	case '5':
		$("#userRoleId5").attr("selected","selected");
	  break;
	case '6':
		$("#userRoleId6").attr("selected","selected");
	  break;
	default:
		alert("错误！userRole error！");
	}
});

</script>
<div class="htmleaf-container">
	<div class="wrapper">
		<div class="container">
			<h1>Welcome</h1>
			
			<form name="user" class="form" id="regist" action="updateUser.action" method="post">
			<input type="hidden" name="user_id" class="input" id="nickname" readonly="readonly" value="${user.user_id }">
				<div class="list">
					<label class="usertitle">UserName:</label>
					<input type="text" name="user_name" value="${user.user_name }" class="userinput" placeholder="Username">
				</div>
				<div class="list">
					<label class="input-title">PassWord:</label>
					<input type="name" name="user_password" value="${user.user_password }" class="userinput" id="name" placeholder="Please input password" validate="require" data-validate-text="" >
				</div>
				<div class="list">
					<label class="input-title">Cellphone:</label>
					<input type="tel" name="user_cellphone" value="${user.user_cellphone }" id="tel" placeholder="Use a commercial phone" class="userinput" validate="isMobile" data-validate-text=""/>
				</div>
				<div class="list">
					<label class="input-title">UserEmail:</label>
					<input type="email" name="user_email" value="${user.user_email }" id="email" placeholder="Please input email" class="userinput" validate="isEmail" data-validate-text=""/>
				</div>
				<div class="list">
					<label class="input-title">Address:</label>
				<input type="text" name="user_address" value="${user.user_address }" id="tel" placeholder="Please input address" class="userinput" validate="" data-validate-text=""/>
				</div>
				<div class="list">Userlevel:</label>
					<input type="text" name="user_levelid" value="${user.user_levelid }" id="tel" placeholder="Please enter 5 ~ 13 level" class="userinput" validate="" data-validate-text=""/>
				</div>
				<div class="list">ErrorTimes:</label>
					<input type="text" name="loginErrorTimes" value="${user.loginErrorTimes }" id="tel" placeholder="Please enter " class="userinput" validate="" data-validate-text=""/>
				</div>
				<%-- <div class="list">UserRole:</label>
					<input type="text" name="user_roleId" value="${user.user_roleId }" id="tel" placeholder="Please enter 5 ~ 13 level" class="userinput" validate="" data-validate-text=""/>
				</div> --%>
				<input id="userRoleId" type="hidden" value="${user.user_roleId}"/>
 					<label>RoleName:</label>
 					<select name="user_roleId" >
						<option id="userRoleId1" value="1">超级管理员</option>
						<option id="userRoleId2" value="2">IT管理员</option>
						<option id="userRoleId3" value="3">图书管理员</option>
						<option id="userRoleId4" value="4">公告管理员</option>
						<option id="userRoleId5" value="5">VIP用户</option>
						<option id="userRoleId6" value="6">普通用户</option>
  					</select>
				<button type="submit" class="btn1" id="submit1">Submit</button>
				<button type="button" class="btn2" id="back" onclick= "window.location='searchByPage.action?number=1'">Return</button>
			</form>
		</div>
		
		<ul class="bg-bubbles">
			<li></li>
			<li></li>
			<li></li>
			<li></li>
			<li></li>
			<li></li>
			<li></li>
			<li></li>
			<li></li>
			<li></li>
		</ul>
	</div>
</div>
			
	
</body>
</html>